Skip to content

[Java][microprofile] generate a Gradle build#24291

Draft
Ignacio-Vidal wants to merge 1 commit into
OpenAPITools:masterfrom
Ignacio-Vidal:java-microprofile-gradle
Draft

[Java][microprofile] generate a Gradle build#24291
Ignacio-Vidal wants to merge 1 commit into
OpenAPITools:masterfrom
Ignacio-Vidal:java-microprofile-gradle

Conversation

@Ignacio-Vidal

@Ignacio-Vidal Ignacio-Vidal commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The microprofile library calls supportingFiles.clear() to drop the extra files added by the common Java client codegen, which also discards the Gradle build (build.gradle, settings.gradle, gradle.properties, gradlew, gradlew.bat and the wrapper). The samples therefore only ever contained a pom.xml, and the Gradle step of the Java client CI job had to be guarded to skip them, so the generated code was never compiled by Gradle.

This adds a build.gradle template for microprofile and re-registers the shared Gradle supporting files, following the same pattern as every other Java client library (each ships its own libraries/<lib>/build.gradle.mustache and inherits the rest from the common Java templates).

  • Java/libraries/microprofile/build.gradle.mustache mirrors the dependencies of the two pom templates: JSON-B / Jackson, MicroProfile Rest Client 2.0 (javax) and 3.0 (jakarta), mutiny, XML and bean validation. The Java release follows the poms (17 when useSealedOneOfInterfaces is set, otherwise 11 for MP 3.0 and 1.8 for MP 2.0).
  • The guard in samples-java-client-jdk17.yaml is removed, so microprofile-oneof-sealed is now built with Gradle like the other samples.

All 13 regenerated microprofile samples (12 clients + samples/server/petstore/java-microprofile, which shares the same code path) were verified locally with gradlew build -x test: the sealed sample on JDK 17 and the remaining ones on JDK 11. JavaClientCodegenTest passes (262 tests).

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Adds Gradle build generation for the Java microprofile library and enables Gradle builds for all MicroProfile samples in CI. This brings microprofile in line with other Java clients and ensures the code is compiled with Gradle.

  • New Features

    • Generate build.gradle for microprofile mirroring existing POMs: JSON‑B/Jackson, MicroProfile Rest Client 2.0 (javax) and 3.0 (jakarta), Mutiny, XML, and Bean Validation.
    • Set Java target: 17 when useSealedOneOfInterfaces is enabled; otherwise 11 for MP 3.0 and 1.8 for MP 2.0.
    • Register shared Gradle files in JavaClientCodegen (build.gradle, settings.gradle, gradle.properties, gradlew, wrapper).
  • Refactors

    • Remove the Gradle-skip guard in samples-java-client-jdk17.yaml; MicroProfile samples now build with Gradle like the rest.

Written for commit a86e2dd. Summary will update on new commits.

Review in cubic

The microprofile library clears the supporting files provided by the
common Java client codegen, which dropped the Gradle build along with
them. As a result the samples only ever had a pom.xml, and the Gradle
step of the Java client CI job had to be guarded to skip them.

Add a microprofile build.gradle template mirroring the dependencies of
the two pom templates (JSON-B/Jackson, MicroProfile Rest Client 2.0/3.0,
mutiny, XML, bean validation) and re-register the shared Gradle
supporting files, as every other Java client library already does.
The guard in the JDK17 workflow is no longer needed.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

29 issues found across 107 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/gradle/wrapper/gradle-wrapper.properties">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/gradle/wrapper/gradle-wrapper.properties:3">
P2: A first-time `./gradlew` download executes Gradle without archive-integrity verification, so a replaced hosted distribution would be accepted. Pin the official 8.7 binary checksum in the wrapper properties.</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-outer-enum/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-outer-enum/build.gradle:74">
P2: JUnit 5 test classes will not execute because `junit-jupiter-api` supplies annotations/assertions but no JUnit Platform engine. Add the Jupiter engine to the test runtime classpath so `gradlew test` actually discovers generated tests.</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-ignore-case/gradle/wrapper/gradle-wrapper.properties">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-ignore-case/gradle/wrapper/gradle-wrapper.properties:3">
P2: First wrapper invocation executes an unpinned remote Gradle distribution, so a compromised or substituted download is accepted. Pin the published distribution SHA-256 to make the wrapper reject altered archives.</violation>
</file>

<file name="samples/client/petstore/java/microprofile-oneof-sealed/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-oneof-sealed/build.gradle:74">
P2: The Gradle test runtime contains only the JUnit API, not a Jupiter TestEngine, so `useJUnitPlatform()` cannot discover or execute `DefaultApiTest` (or generated tests added later). Include the Jupiter aggregate/engine and platform launcher in the test dependencies.</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/build.gradle:77">
P2: `gradlew test` has no JUnit Jupiter engine, so generated JUnit 5 tests cannot be discovered/executed. Include `junit-jupiter-engine` at test runtime (or depend on the `junit-jupiter` aggregate).</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/build.gradle:76">
P2: `gradlew test` cannot launch these JUnit 5 tests because the runtime classpath has the API but no Jupiter test engine. Add `junit-jupiter-engine` as a test runtime dependency.</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-ignore-case/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-ignore-case/build.gradle:51">
P3: Unused version variables in the `ext` block: `jakarta_json_bind_version`, `jakarta_json_version`, `jakarta_xml_bind_version`, and `jaxb_version` are defined but never referenced in any dependency declaration in this build file. These are carry-overs from the non-Jackson JSON-B variant that are not needed here. Consider removing them to avoid confusion about which dependencies are actually used.</violation>

<violation number="2" location="samples/client/petstore/java/microprofile-rest-client-3.0-jackson-ignore-case/build.gradle:77">
P2: `gradlew test` has no JUnit Jupiter TestEngine, so the generated `@Test` methods cannot run. Add the Jupiter engine to the test runtime classpath, matching the other Java Gradle templates.</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-3.0/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-3.0/build.gradle:13">
P3: A build run on a newer JDK can compile calls to post-Java-11 APIs while emitting Java 11 bytecode, causing runtime linkage failures on Java 11. Set `options.release = 11` for the generated Java 11 target.</violation>

<violation number="2" location="samples/client/petstore/java/microprofile-rest-client-3.0/build.gradle:20">
P2: `publish` omits the sources and Javadoc JARs: `archives` does not add them to this `MavenPublication`, whose only input is `components.java`. Configure source/Javadoc variants on `java` (or explicitly attach both tasks to `maven`) before publishing.</violation>

<violation number="3" location="samples/client/petstore/java/microprofile-rest-client-3.0/build.gradle:74">
P2: `./gradlew test` cannot execute the generated Jupiter tests because the runtime classpath has the API but no Jupiter TestEngine (or Platform launcher). Use the Jupiter aggregate and add the JUnit Platform launcher as a test runtime dependency.</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-3.0-jackson/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-3.0-jackson/build.gradle:20">
P3: `publish` will omit the sources and Javadoc artifacts: `archives` does not attach these tasks to the `MavenPublication`. Attach both tasks to `maven` (or use `java { withSourcesJar(); withJavadocJar() }`) so published clients include the artifacts this build creates.</violation>

<violation number="2" location="samples/client/petstore/java/microprofile-rest-client-3.0-jackson/build.gradle:51">
P3: Unused version variables in the `ext` block: `jakarta_json_bind_version`, `jakarta_json_version`, `jakarta_xml_bind_version`, and `jaxb_version` are defined but never referenced in any dependency declaration in this build file. These are carry-overs from the non-Jackson JSON-B variant that are not needed here. Consider removing them to avoid confusion about which dependencies are actually used.</violation>

<violation number="3" location="samples/client/petstore/java/microprofile-rest-client-3.0-jackson/build.gradle:77">
P2: Gradle has no JUnit Jupiter engine to discover the generated `@Test` methods, so `test` can complete without executing this suite. Add `junit-jupiter-engine` at test runtime (or depend on the `junit-jupiter` aggregate).</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-mutiny/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-mutiny/build.gradle:76">
P1: A normal Gradle build fails during test compilation, so this generated client only builds when tests are skipped. Mirror the MicroProfile test runtime dependencies from the POM; include the JUnit engine as well so `useJUnitPlatform()` can execute the generated tests.</violation>

<violation number="2" location="samples/client/petstore/java/microprofile-rest-client-mutiny/build.gradle:76">
P1: The `junit-jupiter-engine` runtime dependency is needed for tests to actually execute with `useJUnitPlatform()`. Without it, no test engine is discovered and zero tests run.

Add this below the existing test dependency:
```groovy
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
```</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/build.gradle:20">
P2: `publish` omits the source and Javadoc JARs even though this build creates them. Attach `sourcesJar` and `javadocJar` to the `MavenPublication` (after those tasks are declared) so published generated clients retain those artifacts.</violation>
</file>

<file name="modules/openapi-generator/src/main/resources/Java/libraries/microprofile/build.gradle.mustache">

<violation number="1" location="modules/openapi-generator/src/main/resources/Java/libraries/microprofile/build.gradle.mustache:111">
P1: MicroProfile 1.x/2.0 clients with `useBeanValidation=true` fail compilation: generated sources import `javax.validation`, but this dependency resolves Bean Validation 3 under `jakarta.validation`. Select the javax Validation API for the non-`microprofile3` branch.</violation>

<violation number="2" location="modules/openapi-generator/src/main/resources/Java/libraries/microprofile/build.gradle.mustache:144">
P2: Generated JUnit tests have no Jupiter engine at runtime, so Gradle cannot execute them under `useJUnitPlatform()`. Add `junit-jupiter-engine` to `testRuntimeOnly`, matching the shared Java build template.</violation>
</file>

<file name="samples/client/petstore/java/microprofile-oneof-interface/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-oneof-interface/build.gradle:20">
P2: The Gradle artifact omits the Jandex index Maven builds produce, so Quarkus consumers will not automatically scan this dependency and `DefaultApi` will not be available for CDI rest-client injection. Configure equivalent Jandex indexing before packaging/publishing.</violation>

<violation number="2" location="samples/client/petstore/java/microprofile-oneof-interface/build.gradle:41">
P3: `publish` will omit the source and Javadoc JARs: adding them to `archives` does not attach them to `MavenPublication`. Add source/Javadoc variants to the Java component or explicitly attach both artifacts to `maven`.</violation>

<violation number="3" location="samples/client/petstore/java/microprofile-oneof-interface/build.gradle:74">
P2: `gradlew test` will not execute the generated JUnit 5 tests because this declares only the API, not a Jupiter engine. Add the engine as a test runtime dependency, matching other Java Gradle samples.</violation>
</file>

<file name="samples/server/petstore/java-microprofile/build.gradle">

<violation number="1" location="samples/server/petstore/java-microprofile/build.gradle:51">
P3: Four `ext` properties in `build.gradle` are defined but never referenced (`jakarta_json_bind_version`, `jakarta_json_version`, `jakarta_xml_bind_version`, `jaxb_version`). Since this generated sample doesn't include dependencies for JSON-B, Jakarta JSON, or JAXB, these properties serve no purpose in this build file. Consider removing them or adding the corresponding dependencies if they are needed.</violation>

<violation number="2" location="samples/server/petstore/java-microprofile/build.gradle:76">
P2: Once a JUnit engine is present, every API test fails during `@BeforeEach` because the Gradle test runtime lacks a `RestClientBuilderResolver` implementation. Mirror the POM's SmallRye test dependencies in this generated build configuration.</violation>

<violation number="3" location="samples/server/petstore/java-microprofile/build.gradle:76">
P2: `gradlew test` has no JUnit Jupiter engine, so the generated `@Test` methods are not executed. Add `junit-jupiter` or `junit-jupiter-engine` as a test runtime dependency (in the template as well, so regeneration preserves it).</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client/build.gradle:13">
P2: Generated builds fail on non-UTF-8 locales because generated sources contain UTF-8 text but compilation uses the platform default encoding. Configure Java compilation and Javadoc for UTF-8.</violation>

<violation number="2" location="samples/client/petstore/java/microprofile-rest-client/build.gradle:14">
P3: This assignment uses `JavaPluginConvention`, deprecated in Gradle 8.7 and removed in Gradle 9. Use the `java { sourceCompatibility ...; targetCompatibility ... }` extension so generated builds remain upgradeable.</violation>

<violation number="3" location="samples/client/petstore/java/microprofile-rest-client/build.gradle:74">
P1: `gradlew test` cannot compile the generated API tests: their `RestClientBuilder` setup needs JAX-RS, which `compileOnly` does not expose to test compilation. Mirror the POM's SmallRye/JAX-RS test classpath and add a JUnit engine so these tests can run.</violation>
</file>

<file name="samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/build.gradle">

<violation number="1" location="samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/build.gradle:74">
P1: Tests will silently pass with zero executions because the JUnit Jupiter engine is not on the test runtime classpath. The `testImplementation` declaration for `junit-jupiter-api` only provides the API (annotations, assertions) but not the engine that discovers and runs `@Test` methods. Calling `gradlew test` will output "0 tests found" and succeed, giving a false sense of test coverage.

Add the engine as a `testRuntimeOnly` dependency to enable actual test execution.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version"
implementation "io.smallrye.reactive:mutiny:$mutiny_version"

testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: A normal Gradle build fails during test compilation, so this generated client only builds when tests are skipped. Mirror the MicroProfile test runtime dependencies from the POM; include the JUnit engine as well so useJUnitPlatform() can execute the generated tests.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/microprofile-rest-client-mutiny/build.gradle, line 76:

<comment>A normal Gradle build fails during test compilation, so this generated client only builds when tests are skipped. Mirror the MicroProfile test runtime dependencies from the POM; include the JUnit engine as well so `useJUnitPlatform()` can execute the generated tests.</comment>

<file context>
@@ -0,0 +1,81 @@
+    implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version"
+    implementation "io.smallrye.reactive:mutiny:$mutiny_version"
+
+    testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
+}
+
</file context>

compileOnly "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
{{#useBeanValidation}}
// Bean Validation API support
compileOnly "jakarta.validation:jakarta.validation-api:$beanvalidation_version"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: MicroProfile 1.x/2.0 clients with useBeanValidation=true fail compilation: generated sources import javax.validation, but this dependency resolves Bean Validation 3 under jakarta.validation. Select the javax Validation API for the non-microprofile3 branch.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/resources/Java/libraries/microprofile/build.gradle.mustache, line 111:

<comment>MicroProfile 1.x/2.0 clients with `useBeanValidation=true` fail compilation: generated sources import `javax.validation`, but this dependency resolves Bean Validation 3 under `jakarta.validation`. Select the javax Validation API for the non-`microprofile3` branch.</comment>

<file context>
@@ -0,0 +1,149 @@
+    compileOnly "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
+    {{#useBeanValidation}}
+    // Bean Validation API support
+    compileOnly "jakarta.validation:jakarta.validation-api:$beanvalidation_version"
+    {{/useBeanValidation}}
+    {{#useBeanValidationFeature}}
</file context>

implementation "jakarta.activation:jakarta.activation-api:$jakarta_activation_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version"

testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: gradlew test cannot compile the generated API tests: their RestClientBuilder setup needs JAX-RS, which compileOnly does not expose to test compilation. Mirror the POM's SmallRye/JAX-RS test classpath and add a JUnit engine so these tests can run.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/microprofile-rest-client/build.gradle, line 74:

<comment>`gradlew test` cannot compile the generated API tests: their `RestClientBuilder` setup needs JAX-RS, which `compileOnly` does not expose to test compilation. Mirror the POM's SmallRye/JAX-RS test classpath and add a JUnit engine so these tests can run.</comment>

<file context>
@@ -0,0 +1,79 @@
+    implementation "jakarta.activation:jakarta.activation-api:$jakarta_activation_version"
+    implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version"
+
+    testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
+}
+
</file context>

implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version"
implementation "io.smallrye.reactive:mutiny:$mutiny_version"

testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The junit-jupiter-engine runtime dependency is needed for tests to actually execute with useJUnitPlatform(). Without it, no test engine is discovered and zero tests run.

Add this below the existing test dependency:

testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/microprofile-rest-client-mutiny/build.gradle, line 76:

<comment>The `junit-jupiter-engine` runtime dependency is needed for tests to actually execute with `useJUnitPlatform()`. Without it, no test engine is discovered and zero tests run.

Add this below the existing test dependency:
```groovy
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
```</comment>

<file context>
@@ -0,0 +1,81 @@
+    implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version"
+    implementation "io.smallrye.reactive:mutiny:$mutiny_version"
+
+    testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
+}
+
</file context>

implementation "jakarta.activation:jakarta.activation-api:$jakarta_activation_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version"

testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Tests will silently pass with zero executions because the JUnit Jupiter engine is not on the test runtime classpath. The testImplementation declaration for junit-jupiter-api only provides the API (annotations, assertions) but not the engine that discovers and runs @Test methods. Calling gradlew test will output "0 tests found" and succeed, giving a false sense of test coverage.

Add the engine as a testRuntimeOnly dependency to enable actual test execution.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/build.gradle, line 74:

<comment>Tests will silently pass with zero executions because the JUnit Jupiter engine is not on the test runtime classpath. The `testImplementation` declaration for `junit-jupiter-api` only provides the API (annotations, assertions) but not the engine that discovers and runs `@Test` methods. Calling `gradlew test` will output "0 tests found" and succeed, giving a false sense of test coverage.

Add the engine as a `testRuntimeOnly` dependency to enable actual test execution.</comment>

<file context>
@@ -0,0 +1,79 @@
+    implementation "jakarta.activation:jakarta.activation-api:$jakarta_activation_version"
+    implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_jaxrs_version"
+
+    testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
+}
+
</file context>
Suggested change
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"

}

artifacts {
archives sourcesJar

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: publish will omit the source and Javadoc JARs: adding them to archives does not attach them to MavenPublication. Add source/Javadoc variants to the Java component or explicitly attach both artifacts to maven.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/microprofile-oneof-interface/build.gradle, line 41:

<comment>`publish` will omit the source and Javadoc JARs: adding them to `archives` does not attach them to `MavenPublication`. Add source/Javadoc variants to the Java component or explicitly attach both artifacts to `maven`.</comment>

<file context>
@@ -0,0 +1,79 @@
+}
+
+artifacts {
+    archives sourcesJar
+    archives javadocJar
+}
</file context>

}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This assignment uses JavaPluginConvention, deprecated in Gradle 8.7 and removed in Gradle 9. Use the java { sourceCompatibility ...; targetCompatibility ... } extension so generated builds remain upgradeable.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/microprofile-rest-client/build.gradle, line 14:

<comment>This assignment uses `JavaPluginConvention`, deprecated in Gradle 8.7 and removed in Gradle 9. Use the `java { sourceCompatibility ...; targetCompatibility ... }` extension so generated builds remain upgradeable.</comment>

<file context>
@@ -0,0 +1,79 @@
+}
+
+sourceCompatibility = JavaVersion.VERSION_1_8
+targetCompatibility = JavaVersion.VERSION_1_8
+
+publishing {
</file context>

jackson_version = "2.17.1"
jakarta_activation_version = "2.1.0"
jakarta_annotation_version = "2.0.0"
jakarta_json_bind_version = "3.0.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Unused version variables in the ext block: jakarta_json_bind_version, jakarta_json_version, jakarta_xml_bind_version, and jaxb_version are defined but never referenced in any dependency declaration in this build file. These are carry-overs from the non-Jackson JSON-B variant that are not needed here. Consider removing them to avoid confusion about which dependencies are actually used.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/microprofile-rest-client-3.0-jackson-ignore-case/build.gradle, line 51:

<comment>Unused version variables in the `ext` block: `jakarta_json_bind_version`, `jakarta_json_version`, `jakarta_xml_bind_version`, and `jaxb_version` are defined but never referenced in any dependency declaration in this build file. These are carry-overs from the non-Jackson JSON-B variant that are not needed here. Consider removing them to avoid confusion about which dependencies are actually used.</comment>

<file context>
@@ -0,0 +1,82 @@
+    jackson_version = "2.17.1"
+    jakarta_activation_version = "2.1.0"
+    jakarta_annotation_version = "2.0.0"
+    jakarta_json_bind_version = "3.0.0"
+    jakarta_json_version = "2.0.1"
+    jakarta_ws_rs_version = "3.0.0"
</file context>

jackson_version = "2.17.1"
jakarta_activation_version = "2.1.0"
jakarta_annotation_version = "2.0.0"
jakarta_json_bind_version = "3.0.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Unused version variables in the ext block: jakarta_json_bind_version, jakarta_json_version, jakarta_xml_bind_version, and jaxb_version are defined but never referenced in any dependency declaration in this build file. These are carry-overs from the non-Jackson JSON-B variant that are not needed here. Consider removing them to avoid confusion about which dependencies are actually used.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/microprofile-rest-client-3.0-jackson/build.gradle, line 51:

<comment>Unused version variables in the `ext` block: `jakarta_json_bind_version`, `jakarta_json_version`, `jakarta_xml_bind_version`, and `jaxb_version` are defined but never referenced in any dependency declaration in this build file. These are carry-overs from the non-Jackson JSON-B variant that are not needed here. Consider removing them to avoid confusion about which dependencies are actually used.</comment>

<file context>
@@ -0,0 +1,82 @@
+    jackson_version = "2.17.1"
+    jakarta_activation_version = "2.1.0"
+    jakarta_annotation_version = "2.0.0"
+    jakarta_json_bind_version = "3.0.0"
+    jakarta_json_version = "2.0.1"
+    jakarta_ws_rs_version = "3.0.0"
</file context>

jackson_version = "2.17.1"
jakarta_activation_version = "1.2.2"
jakarta_annotation_version = "1.3.5"
jakarta_json_bind_version = "1.0.2"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Four ext properties in build.gradle are defined but never referenced (jakarta_json_bind_version, jakarta_json_version, jakarta_xml_bind_version, jaxb_version). Since this generated sample doesn't include dependencies for JSON-B, Jakarta JSON, or JAXB, these properties serve no purpose in this build file. Consider removing them or adding the corresponding dependencies if they are needed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/java-microprofile/build.gradle, line 51:

<comment>Four `ext` properties in `build.gradle` are defined but never referenced (`jakarta_json_bind_version`, `jakarta_json_version`, `jakarta_xml_bind_version`, `jaxb_version`). Since this generated sample doesn't include dependencies for JSON-B, Jakarta JSON, or JAXB, these properties serve no purpose in this build file. Consider removing them or adding the corresponding dependencies if they are needed.</comment>

<file context>
@@ -0,0 +1,81 @@
+    jackson_version = "2.17.1"
+    jakarta_activation_version = "1.2.2"
+    jakarta_annotation_version = "1.3.5"
+    jakarta_json_bind_version = "1.0.2"
+    jakarta_json_version = "1.1.6"
+    jakarta_ws_rs_version = "2.1.6"
</file context>

@Ignacio-Vidal Ignacio-Vidal marked this pull request as draft July 13, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant